// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
const db =cloud.database();
// 云函数入口函数
exports.main = async (event, context) => {
  const openid = cloud.getWXContext().OPENID
  var commonid = event.id;
  var schoolName = event.schoolName
  var locationName = event.locationName
   var a = await db.collection("jf_register").where({
        openid,
        check:true,
        mySchoolName:schoolName,
        mylocationName:locationName
      }).get();
      if(a.data.length)
      {
          //已经进行过认证
          return await db.collection("jf_info").where({
            _id:commonid,
            ispick:false
          }).get();
        
      }
      else{ 
        return false
      }
}